<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script language="javascript">
function showtip()
{
	$("#showshopname").show();
}
function checkson(sonid){
   if(document.getElementById("son"+sonid) != null){//判断有无子菜单
      //如果有子菜单，则子菜单的所有check状态和父亲一样
      var inputs = document.getElementsByName("shopname[]");
      for(var i=0;i<inputs.length;i++){
         if(inputs[i].id == "son"+sonid){
            if(document.getElementById("pre"+sonid).checked == true){
               inputs[i].checked = true;
            }else{
               inputs[i].checked = false;;
            }
         }
      }
   }
}
</script>
<title>编辑员工信息</title>
<body class="withvernav">
<div class="bodywrapper">
 {{include file='/public/leftmenu.tpl'}}
    <div class="centercontent">
    
        <div class="pageheader">
            <h1 class="pagetitle">编辑员工信息【{{$detail.name}}】</h1>
           
        </div><!--pageheader-->
        
        <div id="contentwrapper" class="contentwrapper">
        	
        	<div id="basicform" class="subcontent">
            
					<div class="contenttitle2">
                        <h3>不修改密码请留空</h3>
                    </div><!--contenttitle-->
                    
					<form class="stdform stdform2" method="post" action="/user/saveedit">
                    	<p>
                        	<label>登录帐号：</label>
                            <span class="field">{{$detail.username}}</span>
                        </p>
                        
                        <p>
                        	<label>姓&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;名：</label>
                            <span class="field"><input type="text" name="name" id="name" class="longinput" value="{{$detail.name}}" /></span>
                        </p>
						 <p>
                        	<label>密&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;码：</label>
                            <span class="field"><input type="password" name="password" id="password" class="longinput" value="" /></span>
                        </p>
					
                        
                       <!-- <p>
                        	<label>Email：</label>
                            <span class="field"><input type="text" name="email" id="email2" class="longinput" name="email" /></span>
                        </p>-->
                        
                       
                        
                        <p>
                        	<label>部&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;门：</label>
                            <span class="field"><select name="classid" id="selection2">
                            	<option value="">Choose One</option>
                               {{foreach from=$classid item=li key=key}}
                                <option value="{{$li.id}}" {{if $detail.classid==$li.id}} selected{{/if}}>{{$li.name}}</option>
                                {{/foreach}}
                              
                            </select></span>
                        </p>
                        <p>
                        	<label>职&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;务：</label>
                            <span class="field"><select name="department" id="selection2">
                            	<option value="">Choose One</option>
                               {{foreach from=$usergroup item=li key=key}}
                                <option value="{{$li.id}}" {{if $detail.department==$li.id}} selected{{/if}}>{{$li.title}}</option>
                                {{/foreach}}
                              
                            </select></span>
                        </p>
                        <p>
                        	<label>绑定仓库</label>
                            <span class="field">
                            <select name="seawarehouse[]" multiple="multiple" size="15">
                               {{foreach from=$overseawarehouse item=li key=key}}
                                <option value="{{$li.name}}"  {{if $detail.seawarehouse}}{{if in_array($li.name,$detail.seawarehouse)}} selected{{/if}}{{/if}}>{{$li.name}}</option>
                               {{/foreach}}
                            </select>
                            </span>
                        </p>
                        <p>
                        	<label>绑定店铺：</label>
                            <span class="field">
                            1、数据报表中，查询店铺报表的权限（不绑定，查询不到任何店铺报表）<br>
                            2、订单列表中，查询订单的权限（默认显示所有的店铺订单）<br>
                           
                            <a  class="stdbtn btn_red" onClick="javascript:showtip()">点击显示店铺</a>
                   <table cellpadding="0" cellspacing="0" border="0" class="stdtable" id="showshopname" style="display:none">
                  
                    <thead>
                    <tr>
                    	<td><font color="#FF0000">查看所有店铺订单权限</font> <input type="checkbox" name="shopname[]" {{if $detail.shopname}}{{if in_array('all',$detail.shopname)}}  checked{{/if}}{{/if}}  value="all"  />  </td>
                    </tr>
                      <tr>
                 
                        <td  class="head0"> {{foreach from=$d_shop item=li key=key}}
                          <br> <h4> <input type="checkbox" name="shopID[]" id="pre{{$li.0.platfromname}}" value="{{$li.0.platfromname}}" onClick="checkson('{{$li.0.platfromname}}');"  /> 【{{$key}}平台】</h4>
                       
                          <hr>
                        
                          {{foreach from=$li name=infolist item=res key=key}}
                          
                          <div style="width:200px; float:left;overflow:hidden; text-overflow:ellipsis; white-space:nowrap;">
                          
                          
                          <input type="checkbox" name="shopname[]" id="son{{$res.platfromname}}" value="{{$res.name}}"  {{if $detail.shopname}}{{if in_array($res.name,$detail.shopname)}}  checked{{/if}}{{/if}}  data-text="{{$res.id}}"  />
                            {{if $detail.shopname}}
                            
                            {{if in_array($res.name,$detail.shopname)}} 
                            <font color="red"><B>{{$res.name}}</B></font>
                            {{else}}
                           	 {{$res.name}}
                            {{/if}}
                            
                            {{else}}
                            
                            {{$res.name}}
                            {{/if}}
                             </div>
                           {{if $smarty.foreach.infolist.iteration % 7==0}}
                           <br> 
                            {{/if}}
                          &nbsp;&nbsp;{{/foreach}} <br>
                         
                           <br>  
                         <div style="clear:both"></div>
                          {{/foreach}} </td>
                      </tr>
                     
                    </thead>
                  </table>
                             
                             
                             
                             
                          
                        </p>
                        
                        
                        <p class="stdformbutton">
                        	<button class="submit radius2">Submit Button</button>
                            <input type="hidden"  name="uid" value="{{$detail.id}}" />
                        </p>
                    </form>
					
                    <br />

            </div><!--subcontent-->
            
            <!--subcontent-->
        
        </div><!--contentwrapper-->
        
	</div><!-- centercontent -->
    
    
</div><!--bodywrapper-->

</body>
</html>
